// Upgrade NOTE: commented out 'float4x4 _World2Object', a built-in variable
// Upgrade NOTE: replaced '_World2Object' with 'unity_WorldToObject'
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'

Shader "Hidden/TerrainEngine/Splatmap/Diffuse-AddPass" {
Properties {
[HideInInspector]  _Control ("Control (RGBA)", 2D) = "black" { }
[HideInInspector]  _Splat3 ("Layer 3 (A)", 2D) = "white" { }
[HideInInspector]  _Splat2 ("Layer 2 (B)", 2D) = "white" { }
[HideInInspector]  _Splat1 ("Layer 1 (G)", 2D) = "white" { }
[HideInInspector]  _Splat0 ("Layer 0 (R)", 2D) = "white" { }
[HideInInspector]  _Normal3 ("Normal 3 (A)", 2D) = "bump" { }
[HideInInspector]  _Normal2 ("Normal 2 (B)", 2D) = "bump" { }
[HideInInspector]  _Normal1 ("Normal 1 (G)", 2D) = "bump" { }
[HideInInspector]  _Normal0 ("Normal 0 (R)", 2D) = "bump" { }
}
SubShader { 
 Tags { "QUEUE"="Geometry-99" "IGNOREPROJECTOR"="true" "RenderType"="Opaque" }
 Pass {
  Name "FORWARD"
  Tags { "LIGHTMODE"="ForwardBase" "QUEUE"="Geometry-99" "IGNOREPROJECTOR"="true" "SHADOWSUPPORT"="true" "RenderType"="Opaque" }
  ZWrite Off
  Blend One One
  GpuProgramID 50042
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"
#define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
#define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
#define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
#define conv_mxt4x4_3(mat4x4) float4(mat4x4[0].w,mat4x4[1].w,mat4x4[2].w,mat4x4[3].w)


#define CODE_BLOCK_VERTEX
//uniform float4 unity_SHBr;
//uniform float4 unity_SHBg;
//uniform float4 unity_SHBb;
//uniform float4 unity_SHC;
//uniform float4x4 UNITY_MATRIX_MVP;
//uniform float4x4 unity_ObjectToWorld;
// uniform float4x4 _World2Object;
uniform float4 _Control_ST;
uniform float4 _Splat0_ST;
uniform float4 _Splat1_ST;
uniform float4 _Splat2_ST;
uniform float4 _Splat3_ST;
//uniform float4 _WorldSpaceLightPos0;
//uniform float4 unity_SHAr;
//uniform float4 unity_SHAg;
//uniform float4 unity_SHAb;
uniform float4 _LightColor0;
uniform sampler2D _Control;
uniform sampler2D _Splat0;
uniform sampler2D _Splat1;
uniform sampler2D _Splat2;
uniform sampler2D _Splat3;
struct appdata_t
{
    float4 vertex :POSITION;
    float3 normal :NORMAL;
    float4 texcoord :TEXCOORD0;
};

struct OUT_Data_Vert
{
    float4 xlv_TEXCOORD0 :TEXCOORD0;
    float4 xlv_TEXCOORD1 :TEXCOORD1;
    float3 xlv_TEXCOORD2 :TEXCOORD2;
    float3 xlv_TEXCOORD3 :TEXCOORD3;
    float2 xlv_TEXCOORD4 :TEXCOORD4;
    float3 xlv_TEXCOORD5 :TEXCOORD5;
    float4 xlv_TEXCOORD7 :TEXCOORD7;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float4 xlv_TEXCOORD0 :TEXCOORD0;
    float4 xlv_TEXCOORD1 :TEXCOORD1;
    float3 xlv_TEXCOORD2 :TEXCOORD2;
    float2 xlv_TEXCOORD4 :TEXCOORD4;
    float3 xlv_TEXCOORD5 :TEXCOORD5;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float3 worldNormal_1;
    float4 tmpvar_2;
    float4 tmpvar_3;
    float3 tmpvar_4;
    float4 tmpvar_5;
    tmpvar_2.xy = TRANSFORM_TEX(in_v.texcoord.xy, _Splat0);
    tmpvar_2.zw = TRANSFORM_TEX(in_v.texcoord.xy, _Splat1);
    tmpvar_3.xy = TRANSFORM_TEX(in_v.texcoord.xy, _Splat2);
    tmpvar_3.zw = TRANSFORM_TEX(in_v.texcoord.xy, _Splat3);
    float4 v_6;
    v_6.x = conv_mxt4x4_0(unity_WorldToObject).x;
    v_6.y = conv_mxt4x4_1(unity_WorldToObject).x;
    v_6.z = conv_mxt4x4_2(unity_WorldToObject).x;
    v_6.w = conv_mxt4x4_3(unity_WorldToObject).x;
    float4 v_7;
    v_7.x = conv_mxt4x4_0(unity_WorldToObject).y;
    v_7.y = conv_mxt4x4_1(unity_WorldToObject).y;
    v_7.z = conv_mxt4x4_2(unity_WorldToObject).y;
    v_7.w = conv_mxt4x4_3(unity_WorldToObject).y;
    float4 v_8;
    v_8.x = conv_mxt4x4_0(unity_WorldToObject).z;
    v_8.y = conv_mxt4x4_1(unity_WorldToObject).z;
    v_8.z = conv_mxt4x4_2(unity_WorldToObject).z;
    v_8.w = conv_mxt4x4_3(unity_WorldToObject).z;
    float3 tmpvar_9;
    tmpvar_9 = normalize((((v_6.xyz * in_v.normal.x) + (v_7.xyz * in_v.normal.y)) + (v_8.xyz * in_v.normal.z)));
    worldNormal_1 = tmpvar_9;
    tmpvar_4 = worldNormal_1;
    float3 normal_10;
    normal_10 = worldNormal_1;
    float3 x1_11;
    float4 tmpvar_12;
    tmpvar_12 = (normal_10.xyzz * normal_10.yzzx);
    x1_11.x = dot(unity_SHBr, tmpvar_12);
    x1_11.y = dot(unity_SHBg, tmpvar_12);
    x1_11.z = dot(unity_SHBb, tmpvar_12);
    out_v.vertex = UnityObjectToClipPos(in_v.vertex);
    out_v.xlv_TEXCOORD0 = tmpvar_2;
    out_v.xlv_TEXCOORD1 = tmpvar_3;
    out_v.xlv_TEXCOORD2 = tmpvar_4;
    out_v.xlv_TEXCOORD3 = mul(unity_ObjectToWorld, in_v.vertex).xyz;
    out_v.xlv_TEXCOORD4 = TRANSFORM_TEX(in_v.texcoord.xy, _Control);
    out_v.xlv_TEXCOORD5 = (x1_11 + (unity_SHC.xyz * ((normal_10.x * normal_10.x) - (normal_10.y * normal_10.y))));
    out_v.xlv_TEXCOORD7 = tmpvar_5;
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    float3 tmpvar_1;
    float3 tmpvar_2;
    float4 c_3;
    float3 tmpvar_4;
    float3 lightDir_5;
    float3 tmpvar_6;
    tmpvar_6 = _WorldSpaceLightPos0.xyz;
    lightDir_5 = tmpvar_6;
    tmpvar_4 = in_f.xlv_TEXCOORD2;
    float tmpvar_7;
    float4 splat_control_8;
    float4 mixedDiffuse_9;
    float4 tmpvar_10;
    tmpvar_10 = tex2D(_Control, in_f.xlv_TEXCOORD4);
    splat_control_8 = tmpvar_10;
    float tmpvar_11;
    tmpvar_11 = dot(splat_control_8, float4(1, 1, 1, 1));
    splat_control_8 = (splat_control_8 / (tmpvar_11 + 0.001));
    mixedDiffuse_9 = (splat_control_8.x * tex2D(_Splat0, in_f.xlv_TEXCOORD0.xy));
    mixedDiffuse_9 = (mixedDiffuse_9 + (splat_control_8.y * tex2D(_Splat1, in_f.xlv_TEXCOORD0.zw)));
    mixedDiffuse_9 = (mixedDiffuse_9 + (splat_control_8.z * tex2D(_Splat2, in_f.xlv_TEXCOORD1.xy)));
    mixedDiffuse_9 = (mixedDiffuse_9 + (splat_control_8.w * tex2D(_Splat3, in_f.xlv_TEXCOORD1.zw)));
    tmpvar_7 = tmpvar_11;
    tmpvar_1 = _LightColor0.xyz;
    tmpvar_2 = lightDir_5;
    float3 normalWorld_12;
    normalWorld_12 = tmpvar_4;
    float3 ambient_13;
    float4 tmpvar_14;
    tmpvar_14.w = 1;
    tmpvar_14.xyz = float3(normalWorld_12);
    float3 x_15;
    x_15.x = dot(unity_SHAr, tmpvar_14);
    x_15.y = dot(unity_SHAg, tmpvar_14);
    x_15.z = dot(unity_SHAb, tmpvar_14);
    ambient_13 = max(((1.055 * pow(max(float3(0, 0, 0), (in_f.xlv_TEXCOORD5 + x_15)), float3(0.4166667, 0.4166667, 0.4166667))) - 0.055), float3(0, 0, 0));
    float4 c_16;
    float4 c_17;
    float diff_18;
    float tmpvar_19;
    tmpvar_19 = max(0, dot(tmpvar_4, tmpvar_2));
    diff_18 = tmpvar_19;
    c_17.xyz = ((mixedDiffuse_9.xyz * tmpvar_1) * diff_18);
    c_17.w = tmpvar_7;
    c_16.w = c_17.w;
    c_16.xyz = (c_17.xyz + (mixedDiffuse_9.xyz * ambient_13));
    c_3.xyz = (c_16 * tmpvar_7).xyz;
    c_3.w = 1;
    out_f.color = c_3;
    return out_f;
}


ENDCG

}
 Pass {
  Name "FORWARD"
  Tags { "LIGHTMODE"="ForwardAdd" "QUEUE"="Geometry-99" "IGNOREPROJECTOR"="true" "RenderType"="Opaque" }
  ZWrite Off
  Blend One One
  GpuProgramID 89306
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"
#define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
#define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
#define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
#define conv_mxt4x4_3(mat4x4) float4(mat4x4[0].w,mat4x4[1].w,mat4x4[2].w,mat4x4[3].w)


#define CODE_BLOCK_VERTEX
//uniform float4x4 UNITY_MATRIX_MVP;
//uniform float4x4 unity_ObjectToWorld;
// uniform float4x4 _World2Object;
uniform float4 _Control_ST;
uniform float4 _Splat0_ST;
uniform float4 _Splat1_ST;
uniform float4 _Splat2_ST;
uniform float4 _Splat3_ST;
//uniform float4 _WorldSpaceLightPos0;
uniform float4 _LightColor0;
uniform sampler2D _LightTexture0;
uniform float4x4 unity_WorldToLight;
uniform sampler2D _Control;
uniform sampler2D _Splat0;
uniform sampler2D _Splat1;
uniform sampler2D _Splat2;
uniform sampler2D _Splat3;
struct appdata_t
{
    float4 vertex :POSITION;
    float3 normal :NORMAL;
    float4 texcoord :TEXCOORD0;
};

struct OUT_Data_Vert
{
    float4 xlv_TEXCOORD0 :TEXCOORD0;
    float4 xlv_TEXCOORD1 :TEXCOORD1;
    float3 xlv_TEXCOORD2 :TEXCOORD2;
    float3 xlv_TEXCOORD3 :TEXCOORD3;
    float2 xlv_TEXCOORD4 :TEXCOORD4;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float4 xlv_TEXCOORD0 :TEXCOORD0;
    float4 xlv_TEXCOORD1 :TEXCOORD1;
    float3 xlv_TEXCOORD2 :TEXCOORD2;
    float3 xlv_TEXCOORD3 :TEXCOORD3;
    float2 xlv_TEXCOORD4 :TEXCOORD4;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float3 worldNormal_1;
    float4 tmpvar_2;
    float4 tmpvar_3;
    float3 tmpvar_4;
    tmpvar_2.xy = TRANSFORM_TEX(in_v.texcoord.xy, _Splat0);
    tmpvar_2.zw = TRANSFORM_TEX(in_v.texcoord.xy, _Splat1);
    tmpvar_3.xy = TRANSFORM_TEX(in_v.texcoord.xy, _Splat2);
    tmpvar_3.zw = TRANSFORM_TEX(in_v.texcoord.xy, _Splat3);
    float4 v_5;
    v_5.x = conv_mxt4x4_0(unity_WorldToObject).x;
    v_5.y = conv_mxt4x4_1(unity_WorldToObject).x;
    v_5.z = conv_mxt4x4_2(unity_WorldToObject).x;
    v_5.w = conv_mxt4x4_3(unity_WorldToObject).x;
    float4 v_6;
    v_6.x = conv_mxt4x4_0(unity_WorldToObject).y;
    v_6.y = conv_mxt4x4_1(unity_WorldToObject).y;
    v_6.z = conv_mxt4x4_2(unity_WorldToObject).y;
    v_6.w = conv_mxt4x4_3(unity_WorldToObject).y;
    float4 v_7;
    v_7.x = conv_mxt4x4_0(unity_WorldToObject).z;
    v_7.y = conv_mxt4x4_1(unity_WorldToObject).z;
    v_7.z = conv_mxt4x4_2(unity_WorldToObject).z;
    v_7.w = conv_mxt4x4_3(unity_WorldToObject).z;
    float3 tmpvar_8;
    tmpvar_8 = normalize((((v_5.xyz * in_v.normal.x) + (v_6.xyz * in_v.normal.y)) + (v_7.xyz * in_v.normal.z)));
    worldNormal_1 = tmpvar_8;
    tmpvar_4 = worldNormal_1;
    out_v.vertex = UnityObjectToClipPos(in_v.vertex);
    out_v.xlv_TEXCOORD0 = tmpvar_2;
    out_v.xlv_TEXCOORD1 = tmpvar_3;
    out_v.xlv_TEXCOORD2 = tmpvar_4;
    out_v.xlv_TEXCOORD3 = mul(unity_ObjectToWorld, in_v.vertex).xyz;
    out_v.xlv_TEXCOORD4 = TRANSFORM_TEX(in_v.texcoord.xy, _Control);
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    float3 tmpvar_1;
    float3 tmpvar_2;
    float4 c_3;
    float3 tmpvar_4;
    float3 lightDir_5;
    float3 tmpvar_6;
    tmpvar_6 = normalize((_WorldSpaceLightPos0.xyz - in_f.xlv_TEXCOORD3));
    lightDir_5 = tmpvar_6;
    tmpvar_4 = in_f.xlv_TEXCOORD2;
    float tmpvar_7;
    float4 splat_control_8;
    float4 mixedDiffuse_9;
    float4 tmpvar_10;
    tmpvar_10 = tex2D(_Control, in_f.xlv_TEXCOORD4);
    splat_control_8 = tmpvar_10;
    float tmpvar_11;
    tmpvar_11 = dot(splat_control_8, float4(1, 1, 1, 1));
    splat_control_8 = (splat_control_8 / (tmpvar_11 + 0.001));
    mixedDiffuse_9 = (splat_control_8.x * tex2D(_Splat0, in_f.xlv_TEXCOORD0.xy));
    mixedDiffuse_9 = (mixedDiffuse_9 + (splat_control_8.y * tex2D(_Splat1, in_f.xlv_TEXCOORD0.zw)));
    mixedDiffuse_9 = (mixedDiffuse_9 + (splat_control_8.z * tex2D(_Splat2, in_f.xlv_TEXCOORD1.xy)));
    mixedDiffuse_9 = (mixedDiffuse_9 + (splat_control_8.w * tex2D(_Splat3, in_f.xlv_TEXCOORD1.zw)));
    tmpvar_7 = tmpvar_11;
    float4 tmpvar_12;
    tmpvar_12.w = 1;
    tmpvar_12.xyz = in_f.xlv_TEXCOORD3;
    float3 tmpvar_13;
    tmpvar_13 = mul(unity_WorldToLight, tmpvar_12).xyz;
    float tmpvar_14;
    tmpvar_14 = dot(tmpvar_13, tmpvar_13);
    float tmpvar_15;
    tmpvar_15 = tex2D(_LightTexture0, float2(tmpvar_14, tmpvar_14)).w;
    tmpvar_1 = _LightColor0.xyz;
    tmpvar_2 = lightDir_5;
    tmpvar_1 = (tmpvar_1 * tmpvar_15);
    float4 c_16;
    float4 c_17;
    float diff_18;
    float tmpvar_19;
    tmpvar_19 = max(0, dot(tmpvar_4, tmpvar_2));
    diff_18 = tmpvar_19;
    c_17.xyz = ((mixedDiffuse_9.xyz * tmpvar_1) * diff_18);
    c_17.w = tmpvar_7;
    c_16.w = c_17.w;
    c_16.xyz = c_17.xyz;
    c_3.xyz = c_16.xyz;
    c_3.w = 0;
    c_3.xyz = (c_3 * tmpvar_7).xyz;
    c_3.w = 1;
    out_f.color = c_3;
    return out_f;
}


ENDCG

}
 Pass {
  Name "PREPASS"
  Tags { "LIGHTMODE"="PrePassBase" "QUEUE"="Geometry-99" "IGNOREPROJECTOR"="true" "RenderType"="Opaque" }
  ZWrite Off
  Blend One One
  GpuProgramID 194012
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"
#define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
#define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
#define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
#define conv_mxt4x4_3(mat4x4) float4(mat4x4[0].w,mat4x4[1].w,mat4x4[2].w,mat4x4[3].w)


#define CODE_BLOCK_VERTEX
//uniform float4x4 UNITY_MATRIX_MVP;
//uniform float4x4 unity_ObjectToWorld;
// uniform float4x4 _World2Object;
uniform float4 _Control_ST;
uniform sampler2D _Control;
struct appdata_t
{
    float4 vertex :POSITION;
    float3 normal :NORMAL;
    float4 texcoord :TEXCOORD0;
};

struct OUT_Data_Vert
{
    float3 xlv_TEXCOORD0 :TEXCOORD0;
    float3 xlv_TEXCOORD1 :TEXCOORD1;
    float2 xlv_TEXCOORD2 :TEXCOORD2;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float3 xlv_TEXCOORD0 :TEXCOORD0;
    float2 xlv_TEXCOORD2 :TEXCOORD2;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float3 worldNormal_1;
    float3 tmpvar_2;
    float4 v_3;
    v_3.x = conv_mxt4x4_0(unity_WorldToObject).x;
    v_3.y = conv_mxt4x4_1(unity_WorldToObject).x;
    v_3.z = conv_mxt4x4_2(unity_WorldToObject).x;
    v_3.w = conv_mxt4x4_3(unity_WorldToObject).x;
    float4 v_4;
    v_4.x = conv_mxt4x4_0(unity_WorldToObject).y;
    v_4.y = conv_mxt4x4_1(unity_WorldToObject).y;
    v_4.z = conv_mxt4x4_2(unity_WorldToObject).y;
    v_4.w = conv_mxt4x4_3(unity_WorldToObject).y;
    float4 v_5;
    v_5.x = conv_mxt4x4_0(unity_WorldToObject).z;
    v_5.y = conv_mxt4x4_1(unity_WorldToObject).z;
    v_5.z = conv_mxt4x4_2(unity_WorldToObject).z;
    v_5.w = conv_mxt4x4_3(unity_WorldToObject).z;
    float3 tmpvar_6;
    tmpvar_6 = normalize((((v_3.xyz * in_v.normal.x) + (v_4.xyz * in_v.normal.y)) + (v_5.xyz * in_v.normal.z)));
    worldNormal_1 = tmpvar_6;
    tmpvar_2 = worldNormal_1;
    out_v.vertex = UnityObjectToClipPos(in_v.vertex);
    out_v.xlv_TEXCOORD0 = tmpvar_2;
    out_v.xlv_TEXCOORD1 = mul(unity_ObjectToWorld, in_v.vertex).xyz;
    out_v.xlv_TEXCOORD2 = TRANSFORM_TEX(in_v.texcoord.xy, _Control);
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    float4 res_1;
    float3 tmpvar_2;
    tmpvar_2 = in_f.xlv_TEXCOORD0;
    float tmpvar_3;
    float4 splat_control_4;
    float4 tmpvar_5;
    tmpvar_5 = tex2D(_Control, in_f.xlv_TEXCOORD2);
    splat_control_4 = tmpvar_5;
    float tmpvar_6;
    tmpvar_6 = dot(splat_control_4, float4(1, 1, 1, 1));
    splat_control_4 = (splat_control_4 / (tmpvar_6 + 0.001));
    tmpvar_3 = tmpvar_6;
    res_1.xyz = float3(((tmpvar_2 * 0.5) + 0.5));
    res_1.w = 0;
    float4 normalSpec_7;
    normalSpec_7 = (res_1 * tmpvar_3);
    res_1 = normalSpec_7;
    out_f.color = normalSpec_7;
    return out_f;
}


ENDCG

}
 Pass {
  Name "PREPASS"
  Tags { "LIGHTMODE"="PrePassFinal" "QUEUE"="Geometry-99" "IGNOREPROJECTOR"="true" "RenderType"="Opaque" }
  ZWrite Off
  Blend One One
  GpuProgramID 200693
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"
#define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
#define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
#define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
#define conv_mxt4x4_3(mat4x4) float4(mat4x4[0].w,mat4x4[1].w,mat4x4[2].w,mat4x4[3].w)


#define CODE_BLOCK_VERTEX
//uniform float4 _ProjectionParams;
//uniform float4 unity_SHAr;
//uniform float4 unity_SHAg;
//uniform float4 unity_SHAb;
//uniform float4 unity_SHBr;
//uniform float4 unity_SHBg;
//uniform float4 unity_SHBb;
//uniform float4 unity_SHC;
//uniform float4x4 UNITY_MATRIX_MVP;
//uniform float4x4 unity_ObjectToWorld;
// uniform float4x4 _World2Object;
uniform float4 _Control_ST;
uniform float4 _Splat0_ST;
uniform float4 _Splat1_ST;
uniform float4 _Splat2_ST;
uniform float4 _Splat3_ST;
uniform sampler2D _Control;
uniform sampler2D _Splat0;
uniform sampler2D _Splat1;
uniform sampler2D _Splat2;
uniform sampler2D _Splat3;
uniform sampler2D _LightBuffer;
struct appdata_t
{
    float4 vertex :POSITION;
    float3 normal :NORMAL;
    float4 texcoord :TEXCOORD0;
};

struct OUT_Data_Vert
{
    float4 xlv_TEXCOORD0 :TEXCOORD0;
    float4 xlv_TEXCOORD1 :TEXCOORD1;
    float3 xlv_TEXCOORD2 :TEXCOORD2;
    float2 xlv_TEXCOORD3 :TEXCOORD3;
    float4 xlv_TEXCOORD4 :TEXCOORD4;
    float4 xlv_TEXCOORD5 :TEXCOORD5;
    float3 xlv_TEXCOORD6 :TEXCOORD6;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float4 xlv_TEXCOORD0 :TEXCOORD0;
    float4 xlv_TEXCOORD1 :TEXCOORD1;
    float2 xlv_TEXCOORD3 :TEXCOORD3;
    float4 xlv_TEXCOORD4 :TEXCOORD4;
    float3 xlv_TEXCOORD6 :TEXCOORD6;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float4 tmpvar_1;
    float4 tmpvar_2;
    float4 tmpvar_3;
    float3 tmpvar_4;
    float4 tmpvar_5;
    tmpvar_5 = UnityObjectToClipPos(in_v.vertex);
    tmpvar_1.xy = TRANSFORM_TEX(in_v.texcoord.xy, _Splat0);
    tmpvar_1.zw = TRANSFORM_TEX(in_v.texcoord.xy, _Splat1);
    tmpvar_2.xy = TRANSFORM_TEX(in_v.texcoord.xy, _Splat2);
    tmpvar_2.zw = TRANSFORM_TEX(in_v.texcoord.xy, _Splat3);
    float4 o_6;
    float4 tmpvar_7;
    tmpvar_7 = (tmpvar_5 * 0.5);
    float2 tmpvar_8;
    tmpvar_8.x = tmpvar_7.x;
    tmpvar_8.y = (tmpvar_7.y * _ProjectionParams.x);
    o_6.xy = (tmpvar_8 + tmpvar_7.w);
    o_6.zw = tmpvar_5.zw;
    tmpvar_3.zw = float2(0, 0);
    tmpvar_3.xy = float2(0, 0);
    float4 v_9;
    v_9.x = conv_mxt4x4_0(unity_WorldToObject).x;
    v_9.y = conv_mxt4x4_1(unity_WorldToObject).x;
    v_9.z = conv_mxt4x4_2(unity_WorldToObject).x;
    v_9.w = conv_mxt4x4_3(unity_WorldToObject).x;
    float4 v_10;
    v_10.x = conv_mxt4x4_0(unity_WorldToObject).y;
    v_10.y = conv_mxt4x4_1(unity_WorldToObject).y;
    v_10.z = conv_mxt4x4_2(unity_WorldToObject).y;
    v_10.w = conv_mxt4x4_3(unity_WorldToObject).y;
    float4 v_11;
    v_11.x = conv_mxt4x4_0(unity_WorldToObject).z;
    v_11.y = conv_mxt4x4_1(unity_WorldToObject).z;
    v_11.z = conv_mxt4x4_2(unity_WorldToObject).z;
    v_11.w = conv_mxt4x4_3(unity_WorldToObject).z;
    float4 tmpvar_12;
    tmpvar_12.w = 1;
    tmpvar_12.xyz = normalize((((v_9.xyz * in_v.normal.x) + (v_10.xyz * in_v.normal.y)) + (v_11.xyz * in_v.normal.z)));
    float4 normal_13;
    normal_13 = tmpvar_12;
    float3 res_14;
    float3 x_15;
    x_15.x = dot(unity_SHAr, normal_13);
    x_15.y = dot(unity_SHAg, normal_13);
    x_15.z = dot(unity_SHAb, normal_13);
    float3 x1_16;
    float4 tmpvar_17;
    tmpvar_17 = (normal_13.xyzz * normal_13.yzzx);
    x1_16.x = dot(unity_SHBr, tmpvar_17);
    x1_16.y = dot(unity_SHBg, tmpvar_17);
    x1_16.z = dot(unity_SHBb, tmpvar_17);
    res_14 = (x_15 + (x1_16 + (unity_SHC.xyz * ((normal_13.x * normal_13.x) - (normal_13.y * normal_13.y)))));
    float _tmp_dvx_227 = max(((1.055 * pow(max(res_14, float3(0, 0, 0)), float3(0.4166667, 0.4166667, 0.4166667))) - 0.055), float3(0, 0, 0));
    res_14 = float3(_tmp_dvx_227, _tmp_dvx_227, _tmp_dvx_227);
    tmpvar_4 = res_14;
    out_v.vertex = tmpvar_5;
    out_v.xlv_TEXCOORD0 = tmpvar_1;
    out_v.xlv_TEXCOORD1 = tmpvar_2;
    out_v.xlv_TEXCOORD2 = mul(unity_ObjectToWorld, in_v.vertex).xyz;
    out_v.xlv_TEXCOORD3 = TRANSFORM_TEX(in_v.texcoord.xy, _Control);
    out_v.xlv_TEXCOORD4 = o_6;
    out_v.xlv_TEXCOORD5 = tmpvar_3;
    out_v.xlv_TEXCOORD6 = tmpvar_4;
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    float4 tmpvar_1;
    float4 c_2;
    float4 light_3;
    float tmpvar_4;
    float4 splat_control_5;
    float4 mixedDiffuse_6;
    float4 tmpvar_7;
    tmpvar_7 = tex2D(_Control, in_f.xlv_TEXCOORD3);
    splat_control_5 = tmpvar_7;
    float tmpvar_8;
    tmpvar_8 = dot(splat_control_5, float4(1, 1, 1, 1));
    splat_control_5 = (splat_control_5 / (tmpvar_8 + 0.001));
    mixedDiffuse_6 = (splat_control_5.x * tex2D(_Splat0, in_f.xlv_TEXCOORD0.xy));
    mixedDiffuse_6 = (mixedDiffuse_6 + (splat_control_5.y * tex2D(_Splat1, in_f.xlv_TEXCOORD0.zw)));
    mixedDiffuse_6 = (mixedDiffuse_6 + (splat_control_5.z * tex2D(_Splat2, in_f.xlv_TEXCOORD1.xy)));
    mixedDiffuse_6 = (mixedDiffuse_6 + (splat_control_5.w * tex2D(_Splat3, in_f.xlv_TEXCOORD1.zw)));
    tmpvar_4 = tmpvar_8;
    float4 tmpvar_9;
    tmpvar_9 = tex2D(_LightBuffer, in_f.xlv_TEXCOORD4);
    light_3 = tmpvar_9;
    light_3 = (-log2(max(light_3, float4(0.001, 0.001, 0.001, 0.001))));
    light_3.xyz = (light_3.xyz + in_f.xlv_TEXCOORD6);
    float4 c_10;
    c_10.xyz = (mixedDiffuse_6.xyz * light_3.xyz);
    c_10.w = tmpvar_4;
    c_2 = c_10;
    float4 color_11;
    color_11 = c_2;
    color_11 = (color_11 * tmpvar_4);
    c_2.xyz = color_11.xyz;
    c_2.w = 1;
    tmpvar_1 = c_2;
    out_f.color = tmpvar_1;
    return out_f;
}


ENDCG

}
 Pass {
  Name "DEFERRED"
  Tags { "LIGHTMODE"="Deferred" "QUEUE"="Geometry-99" "IGNOREPROJECTOR"="true" "RenderType"="Opaque" }
  ZWrite Off
  Blend One One
  GpuProgramID 268426
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"
#define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
#define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
#define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
#define conv_mxt4x4_3(mat4x4) float4(mat4x4[0].w,mat4x4[1].w,mat4x4[2].w,mat4x4[3].w)


#define CODE_BLOCK_VERTEX
//uniform float4 unity_SHBr;
//uniform float4 unity_SHBg;
//uniform float4 unity_SHBb;
//uniform float4 unity_SHC;
//uniform float4x4 UNITY_MATRIX_MVP;
//uniform float4x4 unity_ObjectToWorld;
// uniform float4x4 _World2Object;
uniform float4 _Control_ST;
uniform float4 _Splat0_ST;
uniform float4 _Splat1_ST;
uniform float4 _Splat2_ST;
uniform float4 _Splat3_ST;
//uniform float4 unity_SHAr;
//uniform float4 unity_SHAg;
//uniform float4 unity_SHAb;
uniform sampler2D _Control;
uniform sampler2D _Splat0;
uniform sampler2D _Splat1;
uniform sampler2D _Splat2;
uniform sampler2D _Splat3;
struct appdata_t
{
    float4 vertex :POSITION;
    float3 normal :NORMAL;
    float4 texcoord :TEXCOORD0;
};

struct OUT_Data_Vert
{
    float4 xlv_TEXCOORD0 :TEXCOORD0;
    float4 xlv_TEXCOORD1 :TEXCOORD1;
    float3 xlv_TEXCOORD2 :TEXCOORD2;
    float3 xlv_TEXCOORD3 :TEXCOORD3;
    float2 xlv_TEXCOORD4 :TEXCOORD4;
    float4 xlv_TEXCOORD5 :TEXCOORD5;
    float3 xlv_TEXCOORD6 :TEXCOORD6;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float4 xlv_TEXCOORD0 :TEXCOORD0;
    float4 xlv_TEXCOORD1 :TEXCOORD1;
    float3 xlv_TEXCOORD2 :TEXCOORD2;
    float2 xlv_TEXCOORD4 :TEXCOORD4;
    float3 xlv_TEXCOORD6 :TEXCOORD6;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
    float4 color1 :SV_Target1;
    float4 color2 :SV_Target2;
    float4 color3 :SV_Target3;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float3 worldNormal_1;
    float4 tmpvar_2;
    float4 tmpvar_3;
    float3 tmpvar_4;
    float4 tmpvar_5;
    tmpvar_2.xy = TRANSFORM_TEX(in_v.texcoord.xy, _Splat0);
    tmpvar_2.zw = TRANSFORM_TEX(in_v.texcoord.xy, _Splat1);
    tmpvar_3.xy = TRANSFORM_TEX(in_v.texcoord.xy, _Splat2);
    tmpvar_3.zw = TRANSFORM_TEX(in_v.texcoord.xy, _Splat3);
    float4 v_6;
    v_6.x = conv_mxt4x4_0(unity_WorldToObject).x;
    v_6.y = conv_mxt4x4_1(unity_WorldToObject).x;
    v_6.z = conv_mxt4x4_2(unity_WorldToObject).x;
    v_6.w = conv_mxt4x4_3(unity_WorldToObject).x;
    float4 v_7;
    v_7.x = conv_mxt4x4_0(unity_WorldToObject).y;
    v_7.y = conv_mxt4x4_1(unity_WorldToObject).y;
    v_7.z = conv_mxt4x4_2(unity_WorldToObject).y;
    v_7.w = conv_mxt4x4_3(unity_WorldToObject).y;
    float4 v_8;
    v_8.x = conv_mxt4x4_0(unity_WorldToObject).z;
    v_8.y = conv_mxt4x4_1(unity_WorldToObject).z;
    v_8.z = conv_mxt4x4_2(unity_WorldToObject).z;
    v_8.w = conv_mxt4x4_3(unity_WorldToObject).z;
    float3 tmpvar_9;
    tmpvar_9 = normalize((((v_6.xyz * in_v.normal.x) + (v_7.xyz * in_v.normal.y)) + (v_8.xyz * in_v.normal.z)));
    worldNormal_1 = tmpvar_9;
    tmpvar_4 = worldNormal_1;
    tmpvar_5.zw = float2(0, 0);
    tmpvar_5.xy = float2(0, 0);
    float3 normal_10;
    normal_10 = worldNormal_1;
    float3 x1_11;
    float4 tmpvar_12;
    tmpvar_12 = (normal_10.xyzz * normal_10.yzzx);
    x1_11.x = dot(unity_SHBr, tmpvar_12);
    x1_11.y = dot(unity_SHBg, tmpvar_12);
    x1_11.z = dot(unity_SHBb, tmpvar_12);
    out_v.vertex = UnityObjectToClipPos(in_v.vertex);
    out_v.xlv_TEXCOORD0 = tmpvar_2;
    out_v.xlv_TEXCOORD1 = tmpvar_3;
    out_v.xlv_TEXCOORD2 = tmpvar_4;
    out_v.xlv_TEXCOORD3 = mul(unity_ObjectToWorld, in_v.vertex).xyz;
    out_v.xlv_TEXCOORD4 = TRANSFORM_TEX(in_v.texcoord.xy, _Control);
    out_v.xlv_TEXCOORD5 = tmpvar_5;
    out_v.xlv_TEXCOORD6 = (x1_11 + (unity_SHC.xyz * ((normal_10.x * normal_10.x) - (normal_10.y * normal_10.y))));
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    float4 outDiffuse_1;
    float4 outEmission_2;
    float3 tmpvar_3;
    tmpvar_3 = in_f.xlv_TEXCOORD2;
    float tmpvar_4;
    float4 splat_control_5;
    float4 mixedDiffuse_6;
    float4 tmpvar_7;
    tmpvar_7 = tex2D(_Control, in_f.xlv_TEXCOORD4);
    splat_control_5 = tmpvar_7;
    float tmpvar_8;
    tmpvar_8 = dot(splat_control_5, float4(1, 1, 1, 1));
    splat_control_5 = (splat_control_5 / (tmpvar_8 + 0.001));
    mixedDiffuse_6 = (splat_control_5.x * tex2D(_Splat0, in_f.xlv_TEXCOORD0.xy));
    mixedDiffuse_6 = (mixedDiffuse_6 + (splat_control_5.y * tex2D(_Splat1, in_f.xlv_TEXCOORD0.zw)));
    mixedDiffuse_6 = (mixedDiffuse_6 + (splat_control_5.z * tex2D(_Splat2, in_f.xlv_TEXCOORD1.xy)));
    mixedDiffuse_6 = (mixedDiffuse_6 + (splat_control_5.w * tex2D(_Splat3, in_f.xlv_TEXCOORD1.zw)));
    tmpvar_4 = tmpvar_8;
    float3 normalWorld_9;
    normalWorld_9 = tmpvar_3;
    float4 tmpvar_10;
    tmpvar_10.w = 1;
    tmpvar_10.xyz = float3(normalWorld_9);
    float3 x_11;
    x_11.x = dot(unity_SHAr, tmpvar_10);
    x_11.y = dot(unity_SHAg, tmpvar_10);
    x_11.z = dot(unity_SHAb, tmpvar_10);
    float4 outDiffuseOcclusion_12;
    float4 outNormal_13;
    float4 emission_14;
    float4 tmpvar_15;
    tmpvar_15.w = 1;
    tmpvar_15.xyz = mixedDiffuse_6.xyz;
    outDiffuseOcclusion_12 = tmpvar_15;
    float4 tmpvar_16;
    tmpvar_16.w = 1;
    tmpvar_16.xyz = float3(((tmpvar_3 * 0.5) + 0.5));
    outNormal_13 = tmpvar_16;
    float4 tmpvar_17;
    tmpvar_17.w = 1;
    tmpvar_17.xyz = float3(0, 0, 0);
    emission_14 = tmpvar_17;
    emission_14.xyz = (emission_14.xyz + (mixedDiffuse_6.xyz * max(((1.055 * pow(max(float3(0, 0, 0), (in_f.xlv_TEXCOORD6 + x_11)), float3(0.4166667, 0.4166667, 0.4166667))) - 0.055), float3(0, 0, 0))));
    outEmission_2.w = emission_14.w;
    outEmission_2.xyz = exp2((-emission_14.xyz));
    float4 diffuse_18;
    diffuse_18.w = outDiffuseOcclusion_12.w;
    float4 normal_19;
    normal_19.w = outNormal_13.w;
    float4 emission_20;
    diffuse_18.xyz = (outDiffuseOcclusion_12.xyz * tmpvar_4);
    normal_19.xyz = (outNormal_13.xyz * tmpvar_4);
    emission_20 = (outEmission_2 * tmpvar_4);
    outDiffuse_1.xyz = diffuse_18.xyz;
    outEmission_2 = emission_20;
    outDiffuse_1.w = 1;
    out_f.color = outDiffuse_1;
    out_f.color1 = float4(0, 0, 0, 0);
    out_f.color2 = normal_19;
    out_f.color3 = emission_20;
    return out_f;
}


ENDCG

}
}
SubShader { 
 Tags { "QUEUE"="Geometry-99" "IGNOREPROJECTOR"="true" "RenderType"="Opaque" }
 Pass {
  Name "FORWARD"
  Tags { "LIGHTMODE"="ForwardBase" "QUEUE"="Geometry-99" "IGNOREPROJECTOR"="true" "SHADOWSUPPORT"="true" "RenderType"="Opaque" }
  ZWrite Off
  Blend One One
  GpuProgramID 431694
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"
#define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
#define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
#define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
#define conv_mxt4x4_3(mat4x4) float4(mat4x4[0].w,mat4x4[1].w,mat4x4[2].w,mat4x4[3].w)


#define CODE_BLOCK_VERTEX
//uniform float4 unity_SHAr;
//uniform float4 unity_SHAg;
//uniform float4 unity_SHAb;
//uniform float4 unity_SHBr;
//uniform float4 unity_SHBg;
//uniform float4 unity_SHBb;
//uniform float4 unity_SHC;
//uniform float4x4 UNITY_MATRIX_MVP;
//uniform float4x4 unity_ObjectToWorld;
// uniform float4x4 _World2Object;
uniform float4 _Control_ST;
uniform float4 _Splat0_ST;
uniform float4 _Splat1_ST;
uniform float4 _Splat2_ST;
uniform float4 _Splat3_ST;
//uniform float4 _WorldSpaceLightPos0;
uniform float4 _LightColor0;
uniform sampler2D _Control;
uniform sampler2D _Splat0;
uniform sampler2D _Splat1;
uniform sampler2D _Splat2;
uniform sampler2D _Splat3;
struct appdata_t
{
    float4 vertex :POSITION;
    float3 normal :NORMAL;
    float4 texcoord :TEXCOORD0;
};

struct OUT_Data_Vert
{
    float4 xlv_TEXCOORD0 :TEXCOORD0;
    float4 xlv_TEXCOORD1 :TEXCOORD1;
    float3 xlv_TEXCOORD2 :TEXCOORD2;
    float3 xlv_TEXCOORD3 :TEXCOORD3;
    float2 xlv_TEXCOORD4 :TEXCOORD4;
    float3 xlv_TEXCOORD5 :TEXCOORD5;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float4 xlv_TEXCOORD0 :TEXCOORD0;
    float4 xlv_TEXCOORD1 :TEXCOORD1;
    float3 xlv_TEXCOORD2 :TEXCOORD2;
    float2 xlv_TEXCOORD4 :TEXCOORD4;
    float3 xlv_TEXCOORD5 :TEXCOORD5;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float3 worldNormal_1;
    float4 tmpvar_2;
    float4 tmpvar_3;
    float3 tmpvar_4;
    tmpvar_2.xy = TRANSFORM_TEX(in_v.texcoord.xy, _Splat0);
    tmpvar_2.zw = TRANSFORM_TEX(in_v.texcoord.xy, _Splat1);
    tmpvar_3.xy = TRANSFORM_TEX(in_v.texcoord.xy, _Splat2);
    tmpvar_3.zw = TRANSFORM_TEX(in_v.texcoord.xy, _Splat3);
    float4 v_5;
    v_5.x = conv_mxt4x4_0(unity_WorldToObject).x;
    v_5.y = conv_mxt4x4_1(unity_WorldToObject).x;
    v_5.z = conv_mxt4x4_2(unity_WorldToObject).x;
    v_5.w = conv_mxt4x4_3(unity_WorldToObject).x;
    float4 v_6;
    v_6.x = conv_mxt4x4_0(unity_WorldToObject).y;
    v_6.y = conv_mxt4x4_1(unity_WorldToObject).y;
    v_6.z = conv_mxt4x4_2(unity_WorldToObject).y;
    v_6.w = conv_mxt4x4_3(unity_WorldToObject).y;
    float4 v_7;
    v_7.x = conv_mxt4x4_0(unity_WorldToObject).z;
    v_7.y = conv_mxt4x4_1(unity_WorldToObject).z;
    v_7.z = conv_mxt4x4_2(unity_WorldToObject).z;
    v_7.w = conv_mxt4x4_3(unity_WorldToObject).z;
    float3 tmpvar_8;
    tmpvar_8 = normalize((((v_5.xyz * in_v.normal.x) + (v_6.xyz * in_v.normal.y)) + (v_7.xyz * in_v.normal.z)));
    worldNormal_1 = tmpvar_8;
    tmpvar_4 = worldNormal_1;
    float3 normal_9;
    normal_9 = worldNormal_1;
    float4 tmpvar_10;
    tmpvar_10.w = 1;
    tmpvar_10.xyz = float3(normal_9);
    float3 res_11;
    float3 x_12;
    x_12.x = dot(unity_SHAr, tmpvar_10);
    x_12.y = dot(unity_SHAg, tmpvar_10);
    x_12.z = dot(unity_SHAb, tmpvar_10);
    float3 x1_13;
    float4 tmpvar_14;
    tmpvar_14 = (normal_9.xyzz * normal_9.yzzx);
    x1_13.x = dot(unity_SHBr, tmpvar_14);
    x1_13.y = dot(unity_SHBg, tmpvar_14);
    x1_13.z = dot(unity_SHBb, tmpvar_14);
    res_11 = (x_12 + (x1_13 + (unity_SHC.xyz * ((normal_9.x * normal_9.x) - (normal_9.y * normal_9.y)))));
    float _tmp_dvx_223 = max(((1.055 * pow(max(res_11, float3(0, 0, 0)), float3(0.4166667, 0.4166667, 0.4166667))) - 0.055), float3(0, 0, 0));
    res_11 = float3(_tmp_dvx_223, _tmp_dvx_223, _tmp_dvx_223);
    out_v.vertex = UnityObjectToClipPos(in_v.vertex);
    out_v.xlv_TEXCOORD0 = tmpvar_2;
    out_v.xlv_TEXCOORD1 = tmpvar_3;
    out_v.xlv_TEXCOORD2 = tmpvar_4;
    out_v.xlv_TEXCOORD3 = mul(unity_ObjectToWorld, in_v.vertex).xyz;
    out_v.xlv_TEXCOORD4 = TRANSFORM_TEX(in_v.texcoord.xy, _Control);
    out_v.xlv_TEXCOORD5 = max(float3(0, 0, 0), res_11);
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    float3 tmpvar_1;
    float3 tmpvar_2;
    float4 c_3;
    float3 tmpvar_4;
    float3 lightDir_5;
    float3 tmpvar_6;
    tmpvar_6 = _WorldSpaceLightPos0.xyz;
    lightDir_5 = tmpvar_6;
    tmpvar_4 = in_f.xlv_TEXCOORD2;
    float tmpvar_7;
    float4 splat_control_8;
    float4 mixedDiffuse_9;
    float4 tmpvar_10;
    tmpvar_10 = tex2D(_Control, in_f.xlv_TEXCOORD4);
    splat_control_8 = tmpvar_10;
    float tmpvar_11;
    tmpvar_11 = dot(splat_control_8, float4(1, 1, 1, 1));
    splat_control_8 = (splat_control_8 / (tmpvar_11 + 0.001));
    mixedDiffuse_9 = (splat_control_8.x * tex2D(_Splat0, in_f.xlv_TEXCOORD0.xy));
    mixedDiffuse_9 = (mixedDiffuse_9 + (splat_control_8.y * tex2D(_Splat1, in_f.xlv_TEXCOORD0.zw)));
    mixedDiffuse_9 = (mixedDiffuse_9 + (splat_control_8.z * tex2D(_Splat2, in_f.xlv_TEXCOORD1.xy)));
    mixedDiffuse_9 = (mixedDiffuse_9 + (splat_control_8.w * tex2D(_Splat3, in_f.xlv_TEXCOORD1.zw)));
    tmpvar_7 = tmpvar_11;
    tmpvar_1 = _LightColor0.xyz;
    tmpvar_2 = lightDir_5;
    float4 c_12;
    float4 c_13;
    float diff_14;
    float tmpvar_15;
    tmpvar_15 = max(0, dot(tmpvar_4, tmpvar_2));
    diff_14 = tmpvar_15;
    c_13.xyz = ((mixedDiffuse_9.xyz * tmpvar_1) * diff_14);
    c_13.w = tmpvar_7;
    c_12.w = c_13.w;
    c_12.xyz = (c_13.xyz + (mixedDiffuse_9.xyz * in_f.xlv_TEXCOORD5));
    c_3.xyz = (c_12 * tmpvar_7).xyz;
    c_3.w = 1;
    out_f.color = c_3;
    return out_f;
}


ENDCG

}
 Pass {
  Name "FORWARD"
  Tags { "LIGHTMODE"="ForwardAdd" "QUEUE"="Geometry-99" "IGNOREPROJECTOR"="true" "RenderType"="Opaque" }
  ZWrite Off
  Blend One One
  GpuProgramID 504004
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"
#define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
#define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
#define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
#define conv_mxt4x4_3(mat4x4) float4(mat4x4[0].w,mat4x4[1].w,mat4x4[2].w,mat4x4[3].w)


#define CODE_BLOCK_VERTEX
//uniform float4x4 UNITY_MATRIX_MVP;
//uniform float4x4 unity_ObjectToWorld;
// uniform float4x4 _World2Object;
uniform float4 _Control_ST;
uniform float4 _Splat0_ST;
uniform float4 _Splat1_ST;
uniform float4 _Splat2_ST;
uniform float4 _Splat3_ST;
//uniform float4 _WorldSpaceLightPos0;
uniform float4 _LightColor0;
uniform sampler2D _LightTexture0;
uniform float4x4 unity_WorldToLight;
uniform sampler2D _Control;
uniform sampler2D _Splat0;
uniform sampler2D _Splat1;
uniform sampler2D _Splat2;
uniform sampler2D _Splat3;
struct appdata_t
{
    float4 vertex :POSITION;
    float3 normal :NORMAL;
    float4 texcoord :TEXCOORD0;
};

struct OUT_Data_Vert
{
    float4 xlv_TEXCOORD0 :TEXCOORD0;
    float4 xlv_TEXCOORD1 :TEXCOORD1;
    float3 xlv_TEXCOORD2 :TEXCOORD2;
    float3 xlv_TEXCOORD3 :TEXCOORD3;
    float2 xlv_TEXCOORD4 :TEXCOORD4;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float4 xlv_TEXCOORD0 :TEXCOORD0;
    float4 xlv_TEXCOORD1 :TEXCOORD1;
    float3 xlv_TEXCOORD2 :TEXCOORD2;
    float3 xlv_TEXCOORD3 :TEXCOORD3;
    float2 xlv_TEXCOORD4 :TEXCOORD4;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float3 worldNormal_1;
    float4 tmpvar_2;
    float4 tmpvar_3;
    float3 tmpvar_4;
    tmpvar_2.xy = TRANSFORM_TEX(in_v.texcoord.xy, _Splat0);
    tmpvar_2.zw = TRANSFORM_TEX(in_v.texcoord.xy, _Splat1);
    tmpvar_3.xy = TRANSFORM_TEX(in_v.texcoord.xy, _Splat2);
    tmpvar_3.zw = TRANSFORM_TEX(in_v.texcoord.xy, _Splat3);
    float4 v_5;
    v_5.x = conv_mxt4x4_0(unity_WorldToObject).x;
    v_5.y = conv_mxt4x4_1(unity_WorldToObject).x;
    v_5.z = conv_mxt4x4_2(unity_WorldToObject).x;
    v_5.w = conv_mxt4x4_3(unity_WorldToObject).x;
    float4 v_6;
    v_6.x = conv_mxt4x4_0(unity_WorldToObject).y;
    v_6.y = conv_mxt4x4_1(unity_WorldToObject).y;
    v_6.z = conv_mxt4x4_2(unity_WorldToObject).y;
    v_6.w = conv_mxt4x4_3(unity_WorldToObject).y;
    float4 v_7;
    v_7.x = conv_mxt4x4_0(unity_WorldToObject).z;
    v_7.y = conv_mxt4x4_1(unity_WorldToObject).z;
    v_7.z = conv_mxt4x4_2(unity_WorldToObject).z;
    v_7.w = conv_mxt4x4_3(unity_WorldToObject).z;
    float3 tmpvar_8;
    tmpvar_8 = normalize((((v_5.xyz * in_v.normal.x) + (v_6.xyz * in_v.normal.y)) + (v_7.xyz * in_v.normal.z)));
    worldNormal_1 = tmpvar_8;
    tmpvar_4 = worldNormal_1;
    out_v.vertex = UnityObjectToClipPos(in_v.vertex);
    out_v.xlv_TEXCOORD0 = tmpvar_2;
    out_v.xlv_TEXCOORD1 = tmpvar_3;
    out_v.xlv_TEXCOORD2 = tmpvar_4;
    out_v.xlv_TEXCOORD3 = mul(unity_ObjectToWorld, in_v.vertex).xyz;
    out_v.xlv_TEXCOORD4 = TRANSFORM_TEX(in_v.texcoord.xy, _Control);
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    float3 tmpvar_1;
    float3 tmpvar_2;
    float4 c_3;
    float3 tmpvar_4;
    float3 lightDir_5;
    float3 tmpvar_6;
    tmpvar_6 = normalize((_WorldSpaceLightPos0.xyz - in_f.xlv_TEXCOORD3));
    lightDir_5 = tmpvar_6;
    tmpvar_4 = in_f.xlv_TEXCOORD2;
    float tmpvar_7;
    float4 splat_control_8;
    float4 mixedDiffuse_9;
    float4 tmpvar_10;
    tmpvar_10 = tex2D(_Control, in_f.xlv_TEXCOORD4);
    splat_control_8 = tmpvar_10;
    float tmpvar_11;
    tmpvar_11 = dot(splat_control_8, float4(1, 1, 1, 1));
    splat_control_8 = (splat_control_8 / (tmpvar_11 + 0.001));
    mixedDiffuse_9 = (splat_control_8.x * tex2D(_Splat0, in_f.xlv_TEXCOORD0.xy));
    mixedDiffuse_9 = (mixedDiffuse_9 + (splat_control_8.y * tex2D(_Splat1, in_f.xlv_TEXCOORD0.zw)));
    mixedDiffuse_9 = (mixedDiffuse_9 + (splat_control_8.z * tex2D(_Splat2, in_f.xlv_TEXCOORD1.xy)));
    mixedDiffuse_9 = (mixedDiffuse_9 + (splat_control_8.w * tex2D(_Splat3, in_f.xlv_TEXCOORD1.zw)));
    tmpvar_7 = tmpvar_11;
    float4 tmpvar_12;
    tmpvar_12.w = 1;
    tmpvar_12.xyz = in_f.xlv_TEXCOORD3;
    float3 tmpvar_13;
    tmpvar_13 = mul(unity_WorldToLight, tmpvar_12).xyz;
    float tmpvar_14;
    tmpvar_14 = dot(tmpvar_13, tmpvar_13);
    float tmpvar_15;
    tmpvar_15 = tex2D(_LightTexture0, float2(tmpvar_14, tmpvar_14)).w;
    tmpvar_1 = _LightColor0.xyz;
    tmpvar_2 = lightDir_5;
    tmpvar_1 = (tmpvar_1 * tmpvar_15);
    float4 c_16;
    float4 c_17;
    float diff_18;
    float tmpvar_19;
    tmpvar_19 = max(0, dot(tmpvar_4, tmpvar_2));
    diff_18 = tmpvar_19;
    c_17.xyz = ((mixedDiffuse_9.xyz * tmpvar_1) * diff_18);
    c_17.w = tmpvar_7;
    c_16.w = c_17.w;
    c_16.xyz = c_17.xyz;
    c_3.xyz = c_16.xyz;
    c_3.w = 0;
    c_3.xyz = (c_3 * tmpvar_7).xyz;
    c_3.w = 1;
    out_f.color = c_3;
    return out_f;
}


ENDCG

}
 Pass {
  Name "PREPASS"
  Tags { "LIGHTMODE"="PrePassBase" "QUEUE"="Geometry-99" "IGNOREPROJECTOR"="true" "RenderType"="Opaque" }
  ZWrite Off
  Blend One One
  GpuProgramID 543374
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"
#define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
#define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
#define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
#define conv_mxt4x4_3(mat4x4) float4(mat4x4[0].w,mat4x4[1].w,mat4x4[2].w,mat4x4[3].w)


#define CODE_BLOCK_VERTEX
//uniform float4x4 UNITY_MATRIX_MVP;
//uniform float4x4 unity_ObjectToWorld;
// uniform float4x4 _World2Object;
uniform float4 _Control_ST;
uniform sampler2D _Control;
struct appdata_t
{
    float4 vertex :POSITION;
    float3 normal :NORMAL;
    float4 texcoord :TEXCOORD0;
};

struct OUT_Data_Vert
{
    float3 xlv_TEXCOORD0 :TEXCOORD0;
    float3 xlv_TEXCOORD1 :TEXCOORD1;
    float2 xlv_TEXCOORD2 :TEXCOORD2;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float3 xlv_TEXCOORD0 :TEXCOORD0;
    float2 xlv_TEXCOORD2 :TEXCOORD2;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float3 worldNormal_1;
    float3 tmpvar_2;
    float4 v_3;
    v_3.x = conv_mxt4x4_0(unity_WorldToObject).x;
    v_3.y = conv_mxt4x4_1(unity_WorldToObject).x;
    v_3.z = conv_mxt4x4_2(unity_WorldToObject).x;
    v_3.w = conv_mxt4x4_3(unity_WorldToObject).x;
    float4 v_4;
    v_4.x = conv_mxt4x4_0(unity_WorldToObject).y;
    v_4.y = conv_mxt4x4_1(unity_WorldToObject).y;
    v_4.z = conv_mxt4x4_2(unity_WorldToObject).y;
    v_4.w = conv_mxt4x4_3(unity_WorldToObject).y;
    float4 v_5;
    v_5.x = conv_mxt4x4_0(unity_WorldToObject).z;
    v_5.y = conv_mxt4x4_1(unity_WorldToObject).z;
    v_5.z = conv_mxt4x4_2(unity_WorldToObject).z;
    v_5.w = conv_mxt4x4_3(unity_WorldToObject).z;
    float3 tmpvar_6;
    tmpvar_6 = normalize((((v_3.xyz * in_v.normal.x) + (v_4.xyz * in_v.normal.y)) + (v_5.xyz * in_v.normal.z)));
    worldNormal_1 = tmpvar_6;
    tmpvar_2 = worldNormal_1;
    out_v.vertex = UnityObjectToClipPos(in_v.vertex);
    out_v.xlv_TEXCOORD0 = tmpvar_2;
    out_v.xlv_TEXCOORD1 = mul(unity_ObjectToWorld, in_v.vertex).xyz;
    out_v.xlv_TEXCOORD2 = TRANSFORM_TEX(in_v.texcoord.xy, _Control);
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    float4 res_1;
    float3 tmpvar_2;
    tmpvar_2 = in_f.xlv_TEXCOORD0;
    float tmpvar_3;
    float4 splat_control_4;
    float4 tmpvar_5;
    tmpvar_5 = tex2D(_Control, in_f.xlv_TEXCOORD2);
    splat_control_4 = tmpvar_5;
    float tmpvar_6;
    tmpvar_6 = dot(splat_control_4, float4(1, 1, 1, 1));
    splat_control_4 = (splat_control_4 / (tmpvar_6 + 0.001));
    tmpvar_3 = tmpvar_6;
    res_1.xyz = float3(((tmpvar_2 * 0.5) + 0.5));
    res_1.w = 0;
    float4 normalSpec_7;
    normalSpec_7 = (res_1 * tmpvar_3);
    res_1 = normalSpec_7;
    out_f.color = normalSpec_7;
    return out_f;
}


ENDCG

}
 Pass {
  Name "PREPASS"
  Tags { "LIGHTMODE"="PrePassFinal" "QUEUE"="Geometry-99" "IGNOREPROJECTOR"="true" "RenderType"="Opaque" }
  ZWrite Off
  Blend One One
  GpuProgramID 610641
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"
#define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
#define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
#define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
#define conv_mxt4x4_3(mat4x4) float4(mat4x4[0].w,mat4x4[1].w,mat4x4[2].w,mat4x4[3].w)


#define CODE_BLOCK_VERTEX
//uniform float4 _ProjectionParams;
//uniform float4 unity_SHAr;
//uniform float4 unity_SHAg;
//uniform float4 unity_SHAb;
//uniform float4 unity_SHBr;
//uniform float4 unity_SHBg;
//uniform float4 unity_SHBb;
//uniform float4 unity_SHC;
//uniform float4x4 UNITY_MATRIX_MVP;
//uniform float4x4 unity_ObjectToWorld;
// uniform float4x4 _World2Object;
uniform float4 _Control_ST;
uniform float4 _Splat0_ST;
uniform float4 _Splat1_ST;
uniform float4 _Splat2_ST;
uniform float4 _Splat3_ST;
uniform sampler2D _Control;
uniform sampler2D _Splat0;
uniform sampler2D _Splat1;
uniform sampler2D _Splat2;
uniform sampler2D _Splat3;
uniform sampler2D _LightBuffer;
struct appdata_t
{
    float4 vertex :POSITION;
    float3 normal :NORMAL;
    float4 texcoord :TEXCOORD0;
};

struct OUT_Data_Vert
{
    float4 xlv_TEXCOORD0 :TEXCOORD0;
    float4 xlv_TEXCOORD1 :TEXCOORD1;
    float3 xlv_TEXCOORD2 :TEXCOORD2;
    float2 xlv_TEXCOORD3 :TEXCOORD3;
    float4 xlv_TEXCOORD4 :TEXCOORD4;
    float4 xlv_TEXCOORD5 :TEXCOORD5;
    float3 xlv_TEXCOORD6 :TEXCOORD6;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float4 xlv_TEXCOORD0 :TEXCOORD0;
    float4 xlv_TEXCOORD1 :TEXCOORD1;
    float2 xlv_TEXCOORD3 :TEXCOORD3;
    float4 xlv_TEXCOORD4 :TEXCOORD4;
    float3 xlv_TEXCOORD6 :TEXCOORD6;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float4 tmpvar_1;
    float4 tmpvar_2;
    float4 tmpvar_3;
    float3 tmpvar_4;
    float4 tmpvar_5;
    tmpvar_5 = UnityObjectToClipPos(in_v.vertex);
    tmpvar_1.xy = TRANSFORM_TEX(in_v.texcoord.xy, _Splat0);
    tmpvar_1.zw = TRANSFORM_TEX(in_v.texcoord.xy, _Splat1);
    tmpvar_2.xy = TRANSFORM_TEX(in_v.texcoord.xy, _Splat2);
    tmpvar_2.zw = TRANSFORM_TEX(in_v.texcoord.xy, _Splat3);
    float4 o_6;
    float4 tmpvar_7;
    tmpvar_7 = (tmpvar_5 * 0.5);
    float2 tmpvar_8;
    tmpvar_8.x = tmpvar_7.x;
    tmpvar_8.y = (tmpvar_7.y * _ProjectionParams.x);
    o_6.xy = (tmpvar_8 + tmpvar_7.w);
    o_6.zw = tmpvar_5.zw;
    tmpvar_3.zw = float2(0, 0);
    tmpvar_3.xy = float2(0, 0);
    float4 v_9;
    v_9.x = conv_mxt4x4_0(unity_WorldToObject).x;
    v_9.y = conv_mxt4x4_1(unity_WorldToObject).x;
    v_9.z = conv_mxt4x4_2(unity_WorldToObject).x;
    v_9.w = conv_mxt4x4_3(unity_WorldToObject).x;
    float4 v_10;
    v_10.x = conv_mxt4x4_0(unity_WorldToObject).y;
    v_10.y = conv_mxt4x4_1(unity_WorldToObject).y;
    v_10.z = conv_mxt4x4_2(unity_WorldToObject).y;
    v_10.w = conv_mxt4x4_3(unity_WorldToObject).y;
    float4 v_11;
    v_11.x = conv_mxt4x4_0(unity_WorldToObject).z;
    v_11.y = conv_mxt4x4_1(unity_WorldToObject).z;
    v_11.z = conv_mxt4x4_2(unity_WorldToObject).z;
    v_11.w = conv_mxt4x4_3(unity_WorldToObject).z;
    float4 tmpvar_12;
    tmpvar_12.w = 1;
    tmpvar_12.xyz = normalize((((v_9.xyz * in_v.normal.x) + (v_10.xyz * in_v.normal.y)) + (v_11.xyz * in_v.normal.z)));
    float4 normal_13;
    normal_13 = tmpvar_12;
    float3 res_14;
    float3 x_15;
    x_15.x = dot(unity_SHAr, normal_13);
    x_15.y = dot(unity_SHAg, normal_13);
    x_15.z = dot(unity_SHAb, normal_13);
    float3 x1_16;
    float4 tmpvar_17;
    tmpvar_17 = (normal_13.xyzz * normal_13.yzzx);
    x1_16.x = dot(unity_SHBr, tmpvar_17);
    x1_16.y = dot(unity_SHBg, tmpvar_17);
    x1_16.z = dot(unity_SHBb, tmpvar_17);
    res_14 = (x_15 + (x1_16 + (unity_SHC.xyz * ((normal_13.x * normal_13.x) - (normal_13.y * normal_13.y)))));
    float _tmp_dvx_227 = max(((1.055 * pow(max(res_14, float3(0, 0, 0)), float3(0.4166667, 0.4166667, 0.4166667))) - 0.055), float3(0, 0, 0));
    res_14 = float3(_tmp_dvx_227, _tmp_dvx_227, _tmp_dvx_227);
    tmpvar_4 = res_14;
    out_v.vertex = tmpvar_5;
    out_v.xlv_TEXCOORD0 = tmpvar_1;
    out_v.xlv_TEXCOORD1 = tmpvar_2;
    out_v.xlv_TEXCOORD2 = mul(unity_ObjectToWorld, in_v.vertex).xyz;
    out_v.xlv_TEXCOORD3 = TRANSFORM_TEX(in_v.texcoord.xy, _Control);
    out_v.xlv_TEXCOORD4 = o_6;
    out_v.xlv_TEXCOORD5 = tmpvar_3;
    out_v.xlv_TEXCOORD6 = tmpvar_4;
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    float4 tmpvar_1;
    float4 c_2;
    float4 light_3;
    float tmpvar_4;
    float4 splat_control_5;
    float4 mixedDiffuse_6;
    float4 tmpvar_7;
    tmpvar_7 = tex2D(_Control, in_f.xlv_TEXCOORD3);
    splat_control_5 = tmpvar_7;
    float tmpvar_8;
    tmpvar_8 = dot(splat_control_5, float4(1, 1, 1, 1));
    splat_control_5 = (splat_control_5 / (tmpvar_8 + 0.001));
    mixedDiffuse_6 = (splat_control_5.x * tex2D(_Splat0, in_f.xlv_TEXCOORD0.xy));
    mixedDiffuse_6 = (mixedDiffuse_6 + (splat_control_5.y * tex2D(_Splat1, in_f.xlv_TEXCOORD0.zw)));
    mixedDiffuse_6 = (mixedDiffuse_6 + (splat_control_5.z * tex2D(_Splat2, in_f.xlv_TEXCOORD1.xy)));
    mixedDiffuse_6 = (mixedDiffuse_6 + (splat_control_5.w * tex2D(_Splat3, in_f.xlv_TEXCOORD1.zw)));
    tmpvar_4 = tmpvar_8;
    float4 tmpvar_9;
    tmpvar_9 = tex2D(_LightBuffer, in_f.xlv_TEXCOORD4);
    light_3 = tmpvar_9;
    light_3 = (-log2(max(light_3, float4(0.001, 0.001, 0.001, 0.001))));
    light_3.xyz = (light_3.xyz + in_f.xlv_TEXCOORD6);
    float4 c_10;
    c_10.xyz = (mixedDiffuse_6.xyz * light_3.xyz);
    c_10.w = tmpvar_4;
    c_2 = c_10;
    float4 color_11;
    color_11 = c_2;
    color_11 = (color_11 * tmpvar_4);
    c_2.xyz = color_11.xyz;
    c_2.w = 1;
    tmpvar_1 = c_2;
    out_f.color = tmpvar_1;
    return out_f;
}


ENDCG

}
 Pass {
  Name "DEFERRED"
  Tags { "LIGHTMODE"="Deferred" "QUEUE"="Geometry-99" "IGNOREPROJECTOR"="true" "RenderType"="Opaque" }
  ZWrite Off
  Blend One One
  GpuProgramID 671154
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"
#define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
#define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
#define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
#define conv_mxt4x4_3(mat4x4) float4(mat4x4[0].w,mat4x4[1].w,mat4x4[2].w,mat4x4[3].w)


#define CODE_BLOCK_VERTEX
//uniform float4 unity_SHAr;
//uniform float4 unity_SHAg;
//uniform float4 unity_SHAb;
//uniform float4 unity_SHBr;
//uniform float4 unity_SHBg;
//uniform float4 unity_SHBb;
//uniform float4 unity_SHC;
//uniform float4x4 UNITY_MATRIX_MVP;
//uniform float4x4 unity_ObjectToWorld;
// uniform float4x4 _World2Object;
uniform float4 _Control_ST;
uniform float4 _Splat0_ST;
uniform float4 _Splat1_ST;
uniform float4 _Splat2_ST;
uniform float4 _Splat3_ST;
uniform sampler2D _Control;
uniform sampler2D _Splat0;
uniform sampler2D _Splat1;
uniform sampler2D _Splat2;
uniform sampler2D _Splat3;
struct appdata_t
{
    float4 vertex :POSITION;
    float3 normal :NORMAL;
    float4 texcoord :TEXCOORD0;
};

struct OUT_Data_Vert
{
    float4 xlv_TEXCOORD0 :TEXCOORD0;
    float4 xlv_TEXCOORD1 :TEXCOORD1;
    float3 xlv_TEXCOORD2 :TEXCOORD2;
    float3 xlv_TEXCOORD3 :TEXCOORD3;
    float2 xlv_TEXCOORD4 :TEXCOORD4;
    float4 xlv_TEXCOORD5 :TEXCOORD5;
    float3 xlv_TEXCOORD6 :TEXCOORD6;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float4 xlv_TEXCOORD0 :TEXCOORD0;
    float4 xlv_TEXCOORD1 :TEXCOORD1;
    float3 xlv_TEXCOORD2 :TEXCOORD2;
    float2 xlv_TEXCOORD4 :TEXCOORD4;
    float3 xlv_TEXCOORD6 :TEXCOORD6;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
    float4 color1 :SV_Target1;
    float4 color2 :SV_Target2;
    float4 color3 :SV_Target3;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float3 worldNormal_1;
    float4 tmpvar_2;
    float4 tmpvar_3;
    float3 tmpvar_4;
    float4 tmpvar_5;
    tmpvar_2.xy = TRANSFORM_TEX(in_v.texcoord.xy, _Splat0);
    tmpvar_2.zw = TRANSFORM_TEX(in_v.texcoord.xy, _Splat1);
    tmpvar_3.xy = TRANSFORM_TEX(in_v.texcoord.xy, _Splat2);
    tmpvar_3.zw = TRANSFORM_TEX(in_v.texcoord.xy, _Splat3);
    float4 v_6;
    v_6.x = conv_mxt4x4_0(unity_WorldToObject).x;
    v_6.y = conv_mxt4x4_1(unity_WorldToObject).x;
    v_6.z = conv_mxt4x4_2(unity_WorldToObject).x;
    v_6.w = conv_mxt4x4_3(unity_WorldToObject).x;
    float4 v_7;
    v_7.x = conv_mxt4x4_0(unity_WorldToObject).y;
    v_7.y = conv_mxt4x4_1(unity_WorldToObject).y;
    v_7.z = conv_mxt4x4_2(unity_WorldToObject).y;
    v_7.w = conv_mxt4x4_3(unity_WorldToObject).y;
    float4 v_8;
    v_8.x = conv_mxt4x4_0(unity_WorldToObject).z;
    v_8.y = conv_mxt4x4_1(unity_WorldToObject).z;
    v_8.z = conv_mxt4x4_2(unity_WorldToObject).z;
    v_8.w = conv_mxt4x4_3(unity_WorldToObject).z;
    float3 tmpvar_9;
    tmpvar_9 = normalize((((v_6.xyz * in_v.normal.x) + (v_7.xyz * in_v.normal.y)) + (v_8.xyz * in_v.normal.z)));
    worldNormal_1 = tmpvar_9;
    tmpvar_4 = worldNormal_1;
    tmpvar_5.zw = float2(0, 0);
    tmpvar_5.xy = float2(0, 0);
    float3 normal_10;
    normal_10 = worldNormal_1;
    float4 tmpvar_11;
    tmpvar_11.w = 1;
    tmpvar_11.xyz = float3(normal_10);
    float3 res_12;
    float3 x_13;
    x_13.x = dot(unity_SHAr, tmpvar_11);
    x_13.y = dot(unity_SHAg, tmpvar_11);
    x_13.z = dot(unity_SHAb, tmpvar_11);
    float3 x1_14;
    float4 tmpvar_15;
    tmpvar_15 = (normal_10.xyzz * normal_10.yzzx);
    x1_14.x = dot(unity_SHBr, tmpvar_15);
    x1_14.y = dot(unity_SHBg, tmpvar_15);
    x1_14.z = dot(unity_SHBb, tmpvar_15);
    res_12 = (x_13 + (x1_14 + (unity_SHC.xyz * ((normal_10.x * normal_10.x) - (normal_10.y * normal_10.y)))));
    float _tmp_dvx_217 = max(((1.055 * pow(max(res_12, float3(0, 0, 0)), float3(0.4166667, 0.4166667, 0.4166667))) - 0.055), float3(0, 0, 0));
    res_12 = float3(_tmp_dvx_217, _tmp_dvx_217, _tmp_dvx_217);
    out_v.vertex = UnityObjectToClipPos(in_v.vertex);
    out_v.xlv_TEXCOORD0 = tmpvar_2;
    out_v.xlv_TEXCOORD1 = tmpvar_3;
    out_v.xlv_TEXCOORD2 = tmpvar_4;
    out_v.xlv_TEXCOORD3 = mul(unity_ObjectToWorld, in_v.vertex).xyz;
    out_v.xlv_TEXCOORD4 = TRANSFORM_TEX(in_v.texcoord.xy, _Control);
    out_v.xlv_TEXCOORD5 = tmpvar_5;
    out_v.xlv_TEXCOORD6 = max(float3(0, 0, 0), res_12);
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    float4 outDiffuse_1;
    float4 outEmission_2;
    float3 tmpvar_3;
    tmpvar_3 = in_f.xlv_TEXCOORD2;
    float tmpvar_4;
    float4 splat_control_5;
    float4 mixedDiffuse_6;
    float4 tmpvar_7;
    tmpvar_7 = tex2D(_Control, in_f.xlv_TEXCOORD4);
    splat_control_5 = tmpvar_7;
    float tmpvar_8;
    tmpvar_8 = dot(splat_control_5, float4(1, 1, 1, 1));
    splat_control_5 = (splat_control_5 / (tmpvar_8 + 0.001));
    mixedDiffuse_6 = (splat_control_5.x * tex2D(_Splat0, in_f.xlv_TEXCOORD0.xy));
    mixedDiffuse_6 = (mixedDiffuse_6 + (splat_control_5.y * tex2D(_Splat1, in_f.xlv_TEXCOORD0.zw)));
    mixedDiffuse_6 = (mixedDiffuse_6 + (splat_control_5.z * tex2D(_Splat2, in_f.xlv_TEXCOORD1.xy)));
    mixedDiffuse_6 = (mixedDiffuse_6 + (splat_control_5.w * tex2D(_Splat3, in_f.xlv_TEXCOORD1.zw)));
    tmpvar_4 = tmpvar_8;
    float4 outDiffuseOcclusion_9;
    float4 outNormal_10;
    float4 emission_11;
    float4 tmpvar_12;
    tmpvar_12.w = 1;
    tmpvar_12.xyz = mixedDiffuse_6.xyz;
    outDiffuseOcclusion_9 = tmpvar_12;
    float4 tmpvar_13;
    tmpvar_13.w = 1;
    tmpvar_13.xyz = float3(((tmpvar_3 * 0.5) + 0.5));
    outNormal_10 = tmpvar_13;
    float4 tmpvar_14;
    tmpvar_14.w = 1;
    tmpvar_14.xyz = float3(0, 0, 0);
    emission_11 = tmpvar_14;
    emission_11.xyz = (emission_11.xyz + (mixedDiffuse_6.xyz * in_f.xlv_TEXCOORD6));
    outEmission_2.w = emission_11.w;
    outEmission_2.xyz = exp2((-emission_11.xyz));
    float4 diffuse_15;
    diffuse_15.w = outDiffuseOcclusion_9.w;
    float4 normal_16;
    normal_16.w = outNormal_10.w;
    float4 emission_17;
    diffuse_15.xyz = (outDiffuseOcclusion_9.xyz * tmpvar_4);
    normal_16.xyz = (outNormal_10.xyz * tmpvar_4);
    emission_17 = (outEmission_2 * tmpvar_4);
    outDiffuse_1.xyz = diffuse_15.xyz;
    outEmission_2 = emission_17;
    outDiffuse_1.w = 1;
    out_f.color = outDiffuse_1;
    out_f.color1 = float4(0, 0, 0, 0);
    out_f.color2 = normal_16;
    out_f.color3 = emission_17;
    return out_f;
}


ENDCG

}
}
Fallback Off
}